import 'package:flutter/material.dart';

class LayoutCard extends StatelessWidget {
  final Widget child;
  final String? title;
  final double? height;

  const LayoutCard({
    super.key,
    required this.child,
    this.title,
    this.height,
  });

  @override
  Widget build(BuildContext context) {
    return Card(
      child: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            if (title != null)
              Padding(
                padding: const EdgeInsets.only(bottom: 12.0),
                child: Text(title!,
                    style: const TextStyle(
                        fontWeight: FontWeight.w500, fontSize: 16)),
              ),
            SizedBox(
                height: height ?? 100, width: double.infinity, child: child),
          ],
        ),
      ),
    );
  }
}
